﻿@model DiplomaWeb.Models.CompaniesAndLecturers.StudentsPracticeViewModel
<div>
    Направление: <b>@Model.LevelName</b></div>
@using (Html.BeginRouteForm("Default", new { controller = "SystemManagers", action = "UpdateStudentPractice" }))
{
    <table>
        @for (int i = 0; i < Model.Students.Count; i++)
        {
            var customSelectList = new List<SelectListItem>();
            foreach (SelectListItem s in Model.Companies)
            {
                s.Selected = false;
                if (s.Value == Model.Students[i].PracticePlaceId.ToString())
                {
                    s.Selected = true;
                }
                customSelectList.Add(s);
            }
            @Html.HiddenFor(r => r.Students[i].Id)
            <tr class="largeText">
                <td>@Model.Students[i].FIO
                </td>
                <td>@Html.DropDownListFor(r => r.Students[i].PracticePlaceId, customSelectList)
                </td>
            </tr>
        }
    </table>
    <input type="submit" value="Update" />
}